package com.six.work.mapper;

import com.six.work.entity.Ad;
import com.six.work.entity.Admin;
import com.six.work.entity.Applicant;
import com.six.work.entity.Responses;
import org.apache.ibatis.annotations.*;

import java.awt.*;
import java.util.List;

@Mapper
public interface AdminMapper {
    @Select("select * from admin")
    List<Admin> findAllAdmin();

    @Delete("DELETE from admin where admin_id=#{admin_id}")
    Integer DelAdminByID(Integer admin_id);

    @Select("SELECT * from admin where admin_name like '%${adminName}%' \n" +
            "order by admin_id desc")
    List<Admin> findAdminByName(String adminName);

    @Select("SELECT * from admin where admin_id=#{admin_id}")
    Admin SelectAdminByID(Integer admin_id);

    @Select("select * from admin where admin_name=#{admin_name}")   //登陆
    Admin UserLogin(String admin_name);


    @Insert("insert into admin (admin_id,admin_name,admin_group,admin_date,create_date,admin_pass) values(#{admin_id}," +
            "#{admin_name},#{admin_group},#{admin_date},#{create_date},#{admin_pass})")
    Integer insertAdmin(Admin admin);

    @Update("update admin set admin_id=#{admin_id},admin_name=#{admin_name},admin_group=#{admin_group},admin_date=#{admin_date},create_date=#{create_date},admin_pass=#{admin_pass} where admin_id=#{admin_id}")
    Integer updateAdmin(Admin admin);

}
